<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../../../inc/conn.asp"-->
<!--#include file="../common/u.asp"-->
<%links="order"%>
<%
urlid=checkstr(inHTML(request("id")))
if urlid=""  then
response.Write("<script>window.location.href='/';</script>")
response.End()
else 
set rs=server.CreateObject("adodb.recordset")
sql="select * from orderlist where [order]='"&urlid&"'"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.Write("<script>window.location.href='/';</script>")
response.End
else
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>代购订单</title>
<link href="favicon.ico" rel="shortcut icon" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="/css/style.css" />
<script type="text/javascript" src="/js/jquery.min.js"></script>
</head>
<body>

<!--#include file="../../common/top.asp"-->





<div class="fullwidth">
	<div class="place ">
		<a href="/">首页</a> &gt; <a href="/user">会员中心</a> &gt; 代购订单
	</div>
</div>
<!--main-->
<div class="fullwidth bg1">
	<div class="main">
		
		<!--#include file="../common/left.asp"-->
		
		<div class="right_show f_r">
			<div class="title_4">
				<h2>代购详细</h2><div></div>
			</div>
			<div class="clear20"></div>
			<table class="stable">
				<tr class="str">
					<th class="th_1">商品名</th>
					<th class="th_4">商品单价</th>
					<th class="th_3">数量</th>
					<th class="th_3">日本国内运费</th>
					<th class="th_4">备注</th>
					<th class="th_4">总价格（元）</th>				
				</tr>
                
                
                <%
					set rslist=server.CreateObject("adodb.recordset")
					sql="select * from orderdetail where [order]='"&rs("order")&"'"
					rslist.open sql,conn,1,3
					if not rslist.eof then
					do while not rslist.eof
					   set rsSource=conn.execute("select * from Source where id="&rslist("sid")&"") '来源
					   set rsShop=conn.execute("select * from Shop where sid="&rslist("sid")&"") '店铺
					   set rsproduct=conn.execute("select * from product where pid="&rslist("pid")&"") '产品
					%>
				<tr>
					<td>
						<dl>
							<dt><a href=""><img src="<%=rsproduct("pic")%>" alt=""></a></dt>
							<dd><a href="/shopping/<%=rsproduct("pid")%>.html"><%=rslist("title")%></a></dd>
							<dd class="shop_n"><a><%if rsShop("typeid")="0" then response.Write "实体店" else response.Write "购物网"%>-<%=rsShop("address")%>-<%=rsShop("title")%></a></dd>
						</dl>
					</td>
					<td><%=rslist("price")%>日元</td>
					<td><%=rslist("qty")%></td>
					<td><%=rslist("transCost")%>日元</td>
					<td><%=rslist("content")%></td>
					<td><%=(cdbl(rslist("qty"))*cdbl(rslist("price")))+cdbl(rslist("transCost"))%>日元</td>
				</tr>
                <%
					   set rsproduct=nothing
					   set rsShop=nothing
					   set rsSource=nothing
					rslist.movenext
					loop
					rslist.close
					set rslist=nothing
					end if		 
					%> 
                
                
                
				
			</table>
    <div class="clear20"></div>
			<table class="stable stable_1">
				<tr>
					<td class="select_td">有缺货商品存在的时候</td>
					<td><label for="nobuy"><input type="checkbox" name="" id="nobuy"  disabled="disabled" <%if rs("Canlackpro")=false then response.Write " checked"%> /> 有缺货就全部不需要购买</label></td>
				</tr>
			</table>
			
			<div class="clear20"></div>
			<table class="stable stable_1">
				<tr>
					<td class="select_td_1 select_td_norborder">费用一览</td>
					<td class="gray select_td_nolborder" ></td>
				</tr>
				<tr>
					<td class="select_td_1">商品总费用</td>
					<td><%=formatNumber(cdbl(rs("Promoney"))*CDBL(rs("rate")),0)%>RMB (<%=formatNumber(rs("Promoney"),0)%>日元)</td>
				</tr>
				<tr>
					<td class="select_td_1">代购服务费</td>
					<td><%=formatNumber(cdbl(rs("ServiceCost"))*CDBL(rs("rate")),0)%>RMB (<%=formatNumber(rs("ServiceCost"),0)%>日元)</td>
				</tr>
				<tr>
					<td class="select_td_1">总费用</td>
					<td><font class="red"><%=formatNumber(CDBL(cdbl(rs("Promoney"))+cdbl(rs("ServiceCost")))*CDBL(rs("rate")),0)%>RMB (<%=formatNumber(cdbl(rs("Promoney"))+cdbl(rs("ServiceCost")),0)%>日元)</font></td>
				</tr>
				<tr>
					<td class="select_td_1">账户余额</td>
					<td><font class="red"><%=formatNumber(money,0)%>RMB</font> <a href="#" class="recharge">立即充值</a></td>
				</tr>
			</table>
            
            
            <div class="clear20"></div>
			<div class="clear20"></div>
			
            
            <%if rs("flag")=false then%>
			<div class="sure_btn">
				<a href="javascript:if(confirm('您确定取消订单吗？'))location='?del=yes'">取消订单</a>
				<a href="/user/order/change/<%=rs("order")%>">修改订单</a>
				<a href="/user/order/payment/<%=rs("order")%>" class="pay">付款结账</a>
			</div>
			<div class="clear20"></div>
			<div class="clear20"></div>
			<div class="clear20"></div>
			<%end if%>
            
            
            
            
			<div class="title_5">
				<h2>留言板</h2>
			</div>
			
			<div class="clear20"></div>
			
			
            <table class="stable stable_2 message_box_1" style="width:700px; overflow:hidden">
               
			    <%		
				set rsnewx=server.CreateObject("adodb.recordset")
				sql="select id,uid,[Order],[Content],type,isRead,addtime from sms where [order]='"&rs("order")&"' and uid='"&uid&"' order by id desc"
				rsnewx.open sql,conn,1,3
				if not rsnewx.eof then
				do while not rsnewx.eof 			
				if rsnewx("type")="1" then
				%>
				<tr>
					<td class="stable_2_1">
						<div class="send" style="float:left">
							<div class="arrow"></div>
							<p><%=rsnewx("addtime")%></p>
							<p><%=rsnewx("content")%></p>
						</div>
					</td>
				</tr>
                <%else%>
                <tr>
					<td class="stable_2_2">
						<div class="send" style="float:right">
							<div class="arrow1"></div>
							<p><%=rsnewx("addtime")%></p>
							<p><%=rsnewx("content")%></p>
						</div>
					</td>
				</tr>
                <%
				end if
				rsnewx.movenext
				loop
				rsnewx.close
				set rsnewx=nothing
				end if
				%>
			</table>
            
            
            
			<div class="clear20"></div>
			<form name="formreg" method="post" action="" class="messageform" onSubmit="return myjobchk();">
				<textarea name="content" class="textarears"></textarea>				
				<input type="submit" value="提交留言" class="submit" />
                <input type="hidden" name="t" value="y" />
			</form>
		</div>
		
		
	</div>
</div>

<div class="clear"></div>




<!--#include file="../../common/footer.asp"-->


<%
'sms
if request.Form("t")="y" then
content=checkstr(inHTML(request.Form("content")))

if content="" then
response.write"<script>alert('内容不能为空');</script>"
response.write"<script>window.history.back(-1);</script>"
response.end
end if

set rsx=server.createobject("adodb.recordset")
sql="select * from sms "
rsx.open sql,conn,1,3
rsx.addnew
rsx("uid")=uid
rsx("content")=content
rsx("order")=rs("order")
rsx("type")=1
rsx.update
response.write"<script language=JavaScript>{window.alert('提交成功');window.location.href='/user/order/detail/"&rs("order")&"';}</script>"
rsx.close
set rsx=nothing
end if



'取消订单
if request.QueryString("del")="yes" then
conn.execute("delete from orderdetail where [order]='"&rs("order")&"'")
conn.execute("delete from orderlist where [order]='"&rs("order")&"'")
response.Redirect "/user/order"
end if



end if
rs.close
set rs=nothing
end if
%>
</body>
</html>